package com.meida.module.bus.client.enums;


import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import lombok.NoArgsConstructor;

/**
 * 订单支付类型
 *
 * @author gp
 * @date 2021/8/9
 */
@NoArgsConstructor
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
@ApiModel("订单支付类型")
public enum PayTypeEnum {
    /**
     * 订单支付类型(0:未支付,1:已支付)
     */
    WeiXin("wxPay", "微信"),
    LiuBi("balance", "留币");

    @EnumValue
    private String value;
    private String label;

    PayTypeEnum(String value, String label) {
        this.value = value;
        this.label = label;
    }


    public void setValue(String value) {
        this.value = value;
    }

    public String getValue() {
        return value;
    }

    public String getLabel() {
        return label;
    }

    public static PayTypeEnum getByValue(String value) {
        for (PayTypeEnum payTypeEnum : values()) {
            if (payTypeEnum.getValue().equals(value)) {
                return payTypeEnum;
            }
        }
        return null;
    }
}
